<template>
	<div class="home">
		<home-header></home-header>
		<home-banner :imgList="imgList"></home-banner>
		<home-icon :iconList="iconList"></home-icon>
		<home-weeklist :weekList="weekList"></home-weeklist>
		<home-youfav :favList="favList"></home-youfav>
	</div>
</template>
<script>
	import HomeHeader from './component/Header'
	import HomeBanner from './component/Banner'
	import HomeIcon from './component/Icon'
	import HomeWeeklist from './component/Weeklist'
	import HomeYoufav from './component/Youfav'
	import axios from 'axios'
	export default{
		name:"Home",
		data(){
			return {
				favList:[],
				imgList:[],
				iconList:[],
				weekList:[]
			}
		},
		components:{
			HomeHeader,
			HomeBanner,
			HomeIcon,
			HomeWeeklist,
			HomeYoufav
		},
		methods:{
			getInfo(){
				axios.get('/api/index.json').then(this.handleGetInfo)
			},
			handleGetInfo(res){
				let data = res.data.data
				this.favList = data.favList
				this.imgList = data.imgList
				this.iconList = data.iconList
				this.weekList = data.weekList
			}
		},
		mounted(){
			this.getInfo()
		}
	}
</script>
<style lang="less" scoped>
.home{
	background: #eee;
}
</style>